﻿// --------------------------------------------------------------------------------------
// 	文 件 名: mtStruct_Data.cs
// --------------------------------------------------------------------------------------
// 	创建时间: 2021/12/07
// 	版　　本: Version:  1.0.0
// 	版    权: Copyright (C) 2007 - 2021 NUCTECH All Rights Reserved
// 	作    者: chenyu
// --------------------------------------------------------------------------------------
// 	说    明: MTS - 数据结构定义。
// --------------------------------------------------------------------------------------
// 	修改历史:
// 			日期							改动
//		2021.12.07						  创建模块
// --------------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using SH;

namespace MTS
{
    using shBoxU3 = shBox3<uint>;
    using shBoxU2 = shBox2<uint>;

    public class mtStorageComplete : mtObject, shISerializeable
    {
        private string m_prn;
        private long m_nBeginTime;
        private long m_nEndTime;
        private string m_path;//相对路径
        private bool m_bAllFinish;

        public string Prn { get => m_prn; set => m_prn = value; }
        public long BeginTime { get => m_nBeginTime; set => m_nBeginTime = value; }
        public long EndTime { get => m_nEndTime; set => m_nEndTime = value; }
        public string Path { get => m_path; set => m_path = value; }
        public bool AllFinish { get => m_bAllFinish; set => m_bAllFinish = value; }

        public mtStorageComplete()
                : base(0)
        {
        }

        public new shISerializer serialize(shISerializer sc)

        {
            base.serialize(sc);
            sc.serialize(ref m_prn);
            sc.serialize(ref m_bAllFinish);
            sc.serialize(ref m_path);
            sc.serialize(ref m_nBeginTime);
            sc.serialize(ref m_nEndTime);

            return sc;
        }
    }

    public class mtReconComplete : mtObject, shISerializeable
    {
        private string m_prn;
        private long m_nBeginTime = 0;
        private long m_nEndTime = 0;
        private emCargoType m_cargoType = emCargoType.emCT_Unknown;
        private emEnergyType m_energyType = emEnergyType.emET_Unknown;

        private shBoxU3 m_box = new shBoxU3();

        private bool m_bFinish = false;


        public string Prn { get => m_prn; set => m_prn = value; }
        public long BeginTime { get => m_nBeginTime; set => m_nBeginTime = value; }
        public long EndTime { get => m_nEndTime; set => m_nEndTime = value; }
        public emCargoType CargoType { get => m_cargoType; set => m_cargoType = value; }
        public emEnergyType EnergyType { get => m_energyType; set => m_energyType = value; }
        public shBoxU3 Box { get => m_box; set => m_box = value; }
        public bool IsFinish { get => m_bFinish; set => m_bFinish = value; }

        public
            mtReconComplete()
                : base(0)
        { }



        public new shISerializer serialize(shISerializer sc)

        {
            base.serialize(sc);
            sc.serialize(ref m_prn);
            sc.serialize(ref m_nBeginTime);
            sc.serialize(ref m_nEndTime);
            sc.serialize(m_box);
            sc.serialize(ref m_cargoType);
            sc.serialize(ref m_energyType);
            sc.serialize(ref m_bFinish);
            return sc;
        }
    }
	
    public class mtSusRect : shISerializeable
    {
        uint m_nViewId = 0;  // 嫌疑框所在视角
        shBoxU2 m_susRect = new shBoxU2();  // 嫌疑框二维坐标

        public uint ViewId { get => m_nViewId; set => m_nViewId = value; }
        public shBoxU2 Rect { get => m_susRect; set => m_susRect = value; }

        public shISerializer serialize(shISerializer sc)
        {
            sc.serialize(ref m_nViewId);
            sc.serialize(m_susRect);
            return sc;
        }
    }
	
    public class mtSusInfo : mtObject, shISerializeable
    {
        uint m_unLabel = 0;              /*!< 该物体在标号图中的标号1~255. */// 划分key。
        uint m_unType = 0;               /*!< 可疑物体类型:0 -- 早期版本(无此项) 1 -- 块状爆炸物 2 -- 薄片 3 -- 烟花爆竹 4 -- 毒品 5 -- 液态爆炸物 6 穿不透*/
        List<int> m_vecTypes = new List<int>();     /*!< 该可疑区可能的种类，对应危险品属性列表. */
        float m_fQuantity = 0.0f;           /*!< 物质含量. */
        float m_fReliability = 100.0f;            /*!< 可信度，给软件部的接口没有改. */
        float m_fMiul = 0.0f;               // 该物体单能值
        float m_fRhoVal = 0.0f;             /*!< 该物体密度. */
        float m_fZVal = 0.0f;               /*!< 该物体的原子序数. */
        uint m_wMarkFlag = 0;            // 0为自动标记，1为手动标记
        uint m_wEnergyFlag = 0;          // 0为单能识别嫌疑物, 1为双能识别嫌疑物
        byte m_MunualClearFlag = 0;        // 0为自动识别嫌疑物, 1为被站点手动清除
        List<mtSusRect> m_vecRect = new List<mtSusRect>();       // 嫌疑物二维坐标
        shBoxU3 m_susBox = new shBoxU3();               // 嫌疑物三维坐标


        public mtSusInfo()
            : base(0)
        {

        }

        public uint Label { get => m_unLabel; set => m_unLabel = value; }
        public uint Type { get => m_unType; set => m_unType = value; }
        public List<int> Types { get => m_vecTypes; set => m_vecTypes = value; }
        public float Quantity { get => m_fQuantity; set => m_fQuantity = value; }
        public float Reliability { get => m_fReliability; set => m_fReliability = value; }
        public float Miul { get => m_fMiul; set => m_fMiul = value; }
        public float RhoVal { get => m_fRhoVal; set => m_fRhoVal = value; }
        public float ZVal { get => m_fZVal; set => m_fZVal = value; }
        public uint MarkFlag { get => m_wMarkFlag; set => m_wMarkFlag = value; }
        public uint EnergyFlag { get => m_wEnergyFlag; set => m_wEnergyFlag = value; }
        public byte MunualClearFlag { get => m_MunualClearFlag; set => m_MunualClearFlag = value; }
        public List<mtSusRect> Rects { get => m_vecRect; set => m_vecRect = value; }
        public shBoxU3 SusBox { get => m_susBox; set => m_susBox = value; }

        public new shISerializer serialize(shISerializer sc)

        {
            base.serialize(sc);
            sc.serialize(ref m_unLabel);
            sc.serialize(ref m_unType);
            sc.serialize(ref m_fQuantity);
            sc.serialize(ref m_fReliability);
            sc.serialize(ref m_fRhoVal);
            sc.serialize(ref m_fZVal);
            sc.serialize(ref m_fMiul);
            sc.serialize(ref m_wMarkFlag);
            sc.serialize(ref m_wEnergyFlag);
            sc.serialize(ref m_MunualClearFlag);
            sc.serialize(ref m_vecTypes);
            sc.serialize(m_vecRect);
            sc.serialize(m_susBox);
            return sc;
        }
    }
	
    public class mtRecognizeComplete : mtObject, shISerializeable
    {
        string m_prn;
        ulong m_nBeginTime;
        ulong m_nEndTime;

        List<mtSusInfo> m_vecSusInfo = new List<mtSusInfo>();

        bool m_bFinish = false;

        public string Prn { get => m_prn; set => m_prn = value; }
        public ulong BeginTime { get => m_nBeginTime; set => m_nBeginTime = value; }
        public ulong EndTime { get => m_nEndTime; set => m_nEndTime = value; }
        public List<mtSusInfo> SusInfos { get => m_vecSusInfo; set => m_vecSusInfo = value; }
        public bool IsFinish { get => m_bFinish; set => m_bFinish = value; }

        public mtRecognizeComplete()
                : base(0)
        {
        }

        public new shISerializer serialize(shISerializer sc)
        {
            base.serialize(sc);
            sc.serialize(ref m_prn);
            sc.serialize(ref m_nBeginTime);
            sc.serialize(ref m_nEndTime);
            sc.serialize(ref m_bFinish);
            sc.serialize(m_vecSusInfo);

            return sc;
        }
    }
	
    public class mtAlgCheckType : shISerializeable
    {
        uint m_nTypeId = 0u;                      // 识别算法大类Id, 数据库码表定义
        string m_strTypeName;                 // 识别算法大类称, 数据库码表定义
        uint m_nState = 0u;                       // 算法状态，与算法参数一致 0表示关闭，1表示欧盟版本，2表示民航版本，3表示海关版本
        uint m_nThreshold = 0u;                   // 阈值
        uint m_nUnitId = 0u;                      // 阈值单位Id, 数据库码表定义
        string m_strUnitName;                 // 阈值单位名称, 数据库码表定义

        public mtAlgCheckType()
        {
        }

        public uint TypeId
        {
            get => m_nTypeId; set => m_nTypeId = value;
        }



        public string TypeName
        {
            get => m_strTypeName; set => m_strTypeName = value;
        }



        public uint State
        {
            get => m_nState; set => m_nState = value;
        }



        public uint Threshold
        {
            get => m_nThreshold; set => m_nThreshold = value;
        }



        public uint UnitId
        {
            get => m_nUnitId; set => m_nUnitId = value;
        }


        public string UnitName
        {
            get => m_strUnitName; set => m_strUnitName = value;
        }

        public shISerializer serialize(shISerializer sc)
        {
            sc.serialize(ref m_nTypeId);
            sc.serialize(ref m_strTypeName);
            sc.serialize(ref m_nState);
            sc.serialize(ref m_nThreshold);
            sc.serialize(ref m_nUnitId);
            sc.serialize(ref m_strUnitName);

            return sc;
        }
    }

    public class mtAlgInfo : shISerializeable
    {
        uint m_nOperation = 0;                   // 算法设置操作 0--未定义 1--新增 2--修改 3--删除
        bool m_bEnable = false;                        // 算法使能
        bool m_bLoad = false;                      // 模块加载
        string m_strAlgName;                  // 算法模块名称
        string m_strAlgVer;                   // 算法版本
        string m_strAlgDes;                   // 算法描述
        string m_strAlgPath;                  // 算法模块路径
        string m_strCfgPath;                  // 算法配置路径
        uint m_nRiskLevel = 0;                   // 算法风险等级
        List<mtAlgCheckType> m_vecCheckType = new List<mtAlgCheckType>();                 // 算法检查类型

        public mtAlgInfo()

        {
        }

        public uint Operation
        {
            get => m_nOperation; set => m_nOperation = value;
        }



        public bool IsEnable
        {
            get => m_bEnable; set => m_bEnable = value;
        }


        public bool IsLoad
        {
            get => m_bLoad; set => m_bLoad = value;
        }


        public string AlgName
        {
            get => m_strAlgName; set => m_strAlgName = value;
        }


        public string AlgVer
        {
            get => m_strAlgVer; set => m_strAlgVer = value;
        }



        public string AlgDes
        {
            get => m_strAlgDes; set => m_strAlgDes = value;
        }



        public string AlgPath
        {
            get => m_strAlgPath; set => m_strAlgPath = value;
        }


        public string CfgPath
        {
            get => m_strCfgPath; set => m_strCfgPath = value;
        }



        public uint RiskLevel
        {
            get => m_nRiskLevel; set => m_nRiskLevel = value;
        }



        public List<mtAlgCheckType> CheckTypes
        {
            get => m_vecCheckType; set => m_vecCheckType = value;
        }



        public shISerializer serialize(shISerializer sc)

        {
            sc.serialize(ref m_nOperation);
            sc.serialize(ref m_bEnable);
            sc.serialize(ref m_bLoad);
            sc.serialize(ref m_strAlgName);
            sc.serialize(ref m_strAlgVer);
            sc.serialize(ref m_strAlgDes);
            sc.serialize(ref m_strAlgPath);
            sc.serialize(ref m_strCfgPath);
            sc.serialize(ref m_nRiskLevel);
            sc.serialize(m_vecCheckType);

            return sc;
        }


    };

    public class mtRecognizeAlgorithm : mtObject, shISerializeable
    {
        List<mtAlgInfo> m_vecAlgInfo = new List<mtAlgInfo>();

        public mtRecognizeAlgorithm()
                : base(0)

        {
        }


        public List<mtAlgInfo> AlgInfos
        {
            get => m_vecAlgInfo; set => m_vecAlgInfo = value;
        }

        public new shISerializer serialize(shISerializer sc)

        {
            base.serialize(sc);
            sc.serialize(m_vecAlgInfo);

            return sc;
        }
    }

}